#include "Settings.h"
#include <string>
#include <map>
#include <iostream>
#include <fstream>
#include <stdlib.h>

Settings Settings::inst;


Settings::Settings() {

	std::ifstream settings("Settings.txt");
			
	while (!settings.eof()) {
		std::string buf;
		getline(settings, buf);
		int i = buf.find(" ");
		set.insert(std::pair<std::string,int>(buf.substr(0,i),atoi(buf.substr(i+1).c_str())));				
	}
}

Settings Settings::getInstance() {
	return Settings::inst;
}

int Settings::getKey(std::string name) {
	return set.find(name)->second;
}
